import random as r;r.r = r.randint;aba=print
s={}
def n(): pass;pass;pass;pass;s["n"]=r.r(0,10*10*10*10);pass;();();k()
def k(): pass;();();pass;s["N"]=[nN or () or () for nN in str(s["n"])];pass;pass;l()
def l(): pass;();();pass;();s["Nn"]=[int(nNn) or () or () or () for nNn in s["N"]];();pass;None;o()
def o(): pass;pass;();();pass;s["NnN"]=0;b() or ()
def b(): 
    for NNnn in s["Nn"]: s["NnN"]+=NNnn
    p()
def p(): aba(s["NnN"])
n()